#include <stdio.h>

int 
main(void)
{
    int first, middle, last, number;
    
    puts("Enter a three-digit number:");
    scanf("%3d", &number);

    first = number / 100;
    last = number % 10;
    middle = (number - (first * 100) - last) / 10;

    /* shorter expression:
     * number = (number / 10 ) % 10;
     */

    printf("The reversal is: %d%d%d\n", last, middle, first);

    return 0;
}
